//
//  Person.m
//  oc_18
//
//  Created by 楼楚 on 15/9/15.
//  Copyright (c) 2015年 Chu Lou. All rights reserved.
//

#import "Person.h"

@implementation Person
- (Dog *) dog
{
    return _dog;
}
- (void) setDog:(Dog *)newDog
{
    if (_dog != newDog) {
        [_dog release];
        _dog = nil;
//        NSLog(@"%zd",_dog.retainCount);
        _dog  = [newDog retain];
//        NSLog(@"%zd",_dog.retainCount);


    }
}

- (void) dealloc
{
    NSLog(@"person is died");
    [_dog release];
    _dog = nil;
    [super dealloc];
}
@end
